#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   File Name：    upload_file_page.py
   Author :       zyq
   CreateDate：   2024/8/1 18:04
   Remark :  上传文件页面
-------------------------------------------------
"""

from guitesting.common.bash.bash_ui.page_element import PageElement, BasePage


class UploadFilePage(BasePage):
    url = "http://xn--6frwj470ei1s2kl.com/demo/upload"
    # 上传文件
    upload_file_link = PageElement(xpath="/html/body/div[1]/div/div/main/div/div[2]/a[24]")
    #
    upload_file_input = PageElement(xpath="""/html/body/div[1]/div/div/main/div/div/div[1]/div/div/a/span[2]/input""")

    def upload_file(self):
        """上传文件测试"""
        self.get_url(url=self.url)
        # self.upload_file_link.click_element()
        # time.sleep(1)
        self.upload_file_input.input_text(content=TEST_FILE_PATH, mode="exist")
